﻿using DXApplicationTangche.UC.抖音出入库.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.抖音出入库.抖音UC
{
    public partial class Form抖音订单明细 : DevExpress.XtraEditors.XtraForm
    {
        public Form抖音订单明细()
        {
            InitializeComponent();
            this.刷新();
        }
        private void 刷新()
        {
            List<DouyinDeliveryReportDTO> douyinDeliveryReportDTOs = 抖音订单Service.getViewDouyinDeliveryReportAll();
            this.gridControl抖音订单明细.DataSource = douyinDeliveryReportDTOs;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Title = "导出抖音订单";
            fileDialog.Filter = "Excel文件(*.xlsx)|*.xlsx";
            DialogResult dialogResult = fileDialog.ShowDialog(this);
            if (dialogResult == DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                //保存销售收款单、退款退货单、退款未退货单
                this.gridView抖音订单明细.ExportToXlsx(fileDialog.FileName);
                DevExpress.XtraEditors.XtraMessageBox.Show("文件已保存至" + fileDialog.FileName, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void simpleButton刷新_Click(object sender, EventArgs e)
        {
            this.刷新();
        }
    }
}
